/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package plagiadetector.utility;

/**
 *
 * @author Dell
 */
public class DummyCharCounter {
    public static int countAphabeticChars(String s){
        int counter = 0;
        int strlength = s.length();
        char charbuff;
        
        for(int i = 0; i < strlength; i++){
            charbuff = s.charAt(i);
            if(Character.isLetter(charbuff)) counter++;
        }
        return counter;
    }
    
    public static void main(String[] args){
        String[] segmentstrings = new String[10];
        
        segmentstrings[0] = "there was great consternation in fairyland, for it was suddenly discovered that the sun had been shining crookedly all the morning.  it was consequently two hours later than anybody thought it was; and this, as it happened, was a very serious matter, for all the fairies had been invited to the christening of the little prince charming, and it would never do for them to arrive late.  of course, the wymps were at the bottom of it and the sun had no idea that he was not shining quite in his usual way; but no one in fairyland had time to trouble about that, and, without waiting even for the butterflies to be harnessed, away flew all the fairies in a regular scurry.  now, even fairies are apt to do stupid things sometimes, especially when they are flustered and the wymps have been at work; so there may be some excuse for what they did on that particular morning. satin-stitch--except that the heart-shaped features at the base and the lily-shaped flowers, of which only the tips are shown, ar outlined with fine white cord. part of a fan, worked by miss buckle, from a design by l. f. d. (the property of the worker.)  94.   \"i give you beauty,\" said one.  \"and i, thoughtfulness,\" said another. \"and i, wisdom,\" said a third.  \"and i, patience,\" said a fourth.  \"and i, contentment,\" said a fif";
        segmentstrings[1] = "d this, as it happened, was a very serious matter, for all the fairies had been invited to the christening of the little prince charming, and it would never do for them to arrive late.  of course, the wymps were at the bottom of it and the sun had no idea that he was not shining quite in his usual way; but no one in fairyland had time to trouble about that, and, without waiting even for the butterflies to be harnessed, away flew all the fairies in a regular scurry.  now, even fairies are apt to do stupid things sometimes, especially when they are flustered and the wymps have been at work; so there may be some excuse for what they did on that particular morning. satin-stitch--except that the heart-shaped features at the base and the lily-shaped flowers, of which only the tips are shown, are outlined with fine white cord. part of a fan, worked by miss buckle, from a design by l. f. d. (the property of the worker.)  94.   \"i give you beauty,\" said one.  \"and i, thoughtfulness,\" said anoter. \"and i, wisdom,\" said a third.  \"and i, patience,\" said a fourth.  \"and i, contentment,\" said a fifth; and so on, until all the gifts of fairyland had been given to the baby in the nurse's arms.  then, when they had quite finished speaking, the poor, flurried little fairies discovered that the baby was the d";
        segmentstrings[2] = " wymps were at the bottom of it and the sun had no idea that he was not shining quite in his usual way; but no one in fairyland had time to trouble about that, and, without waiting even for the butterflies to be harnessed, away flew all the fairies in a regular scurry.  now, even fairies are apt to do stupid things sometimes, especially when they are flustered and the wymps have been at work; so there may be some excuse for what they did on that particular morning. satin-stitch--except that the heart-shaped features at the base and the lily-shaped flowers, of which only the tips are shown, are outlined with fine white cord. part of a fan, worked by miss buckle, from a design by l. f. d. (the property of the worker.)  94.   \"i give you beauty,\" said one.  \"and i, thoughtfulness,\" said another. \"and i, wisdom,\" said a third.  \"and i, patience,\" said a fourth.  \"and i, contentment,\" said a fifth; and so on, until all the gifts of fairyland had been given to the baby in the nurse's arms. then, when they had quite finished speaking, the poor, flurried little fairies discovered that the baby was the daughter of a poor peasant and his wife, while prince charming lived in quite another country, a very long way off.  it was a great calamity, no doubt, but nothing could be done, for the fairies had no";
        segmentstrings[3] = "flies to be harnessed, away flew all the fairies in a regular scurry.  now, even fairies are apt to do stupid things sometimes, especially when they are flustered and the wymps have been at work; so there may be some excuse for what they did on that particular morning. satin-stitch--except that the heart-shaped features at the base and the lily-shaped flowers, of which only the tips are shown, are outlined with fine white cord. part of a fan, worked by miss buckle, from a design by l. f. d. (the property of the worker.)  94.   \"i give you beauty,\" said one.  \"and i, thoughtfulness,\" said another. \"and i, wisdom,\" said a third.  \"and i, patience,\" said a fourth.  \"and i, contentment,\" said a fifth; and so on, until all the gifts of fairyland had been given to the baby in the nurse's arms.  then, when they had quite finished speaking, the poor, flurried little fairies discovered that the baby was the daughter of a poor peasant and his wife, while prince charming lived in quite another cuntry, a very long way off.  it was a great calamity, no doubt, but nothing could be done, for the fairies had no more gifts left; so they returned very sadly to fairyland, and hoped that the wymps would not find it out.  of course, the wymps did find it out, for they had arranged the whole thing from the very be";
        segmentstrings[4] = "here may be some excuse for what they did on that particular morning. satin-stitch--except that the heart-shaped features at the base and the lily-shaped flowers, of which only the tips are shown, are outlined with fine white cord. part of a fan, worked by miss buckle, from a design by l. f. d. (the property of the worker.)  94.   \"i give you beauty,\" said one.  \"and i, thoughtfulness,\" said another. \"and i, wisdom,\" said a third.  \"and i, patience,\" said a fourth.  \"and i, contentment,\" said a fifth; and so on, until all the gifts of fairyland had been given to the baby in the nurse's arms.  then, when they had quite finished speaking, the poor, flurried little fairies discovered that the baby was the daughter of a poor peasant and his wife, while prince charming lived in quite another country, a very long way off.  it was a great calamity, no doubt, but nothing could be done, for the fairies had no more gifts left; so they returned very sadly to fairyland, and hoped that the wymps wuld not find it out.  of course, the wymps did find it out, for they had arranged the whole thing from the very beginning.  still, the wymps are not nearly so bad as they pretend to be; and when they had finished laughing over their joke they did their best to make things right again by going in large numbers to";
        segmentstrings[5] = " outlined with fine white cord. part of a fan, worked by miss buckle, from a design by l. f. d. (the property of the worker.)  94.   \"i give you beauty,\" said one.  \"and i, thoughtfulness,\" said another. \"and i, wisdom,\" said a third.  \"and i, patience,\" said a fourth.  \"and i, contentment,\" said a fifth; and so on, until all the gifts of fairyland had been given to the baby in the nurse's arms.  then, when they had quite finished speaking, the poor, flurried little fairies discovered that the baby was the daughter of a poor peasant and his wife, while prince charming lived in quite another country, a very long way off.  it was a great calamity, no doubt, but nothing could be done, for the fairies had no more gifts left; so they returned very sadly to fairyland, and hoped that the wymps would not find it out.  of course, the wymps did find it out, for they had arranged the whole thing from the very beginning.  still, the wymps are not nearly so bad as they pretend to be; and when theyhad finished laughing over their joke they did their best to make things right again by going in large numbers to prince charming's christening.  they behaved very noisily when they got there; and they ate every bit of the christening cake and ended in giving the baby prince the only nice gift the wymps have th";
        segmentstrings[6] = "er. \"and i, wisdom,\" said a third.  \"and i, patience,\" said a fourth.  \"and i, contentment,\" said a fifth; and so on, until all the gifts of fairyland had been given to the baby in the nurse's arms.  then, when they had quite finished speaking, the poor, flurried little fairies discovered that the baby was the daughter of a poor peasant and his wife, while prince charming lived in quite another country, a very long way off.  it was a great calamity, no doubt, but nothing could be done, for the fairies had no more gifts left; so they returned very sadly to fairyland, and hoped that the wymps would not find it out.  of course, the wymps did find it out, for they had arranged the whole thing from the very beginning.  still, the wymps are not nearly so bad as they pretend to be; and when they had finished laughing over their joke they did their best to make things right again by going in large numbers to prince charming's christening.  they behaved very noisily when they got there; and thy ate every bit of the christening cake and ended in giving the baby prince the only nice gift the wymps have the power to give; and that is the nicest gift in the world, for it is called laughter.  to be sure, there had never been such a topsy-turvey christening party before; but all the gu";
        segmentstrings[7] = "then, when they had quite finished speaking, the poor, flurried little fairies discovered that the baby was the daughter of a poor peasant and his wife, while prince charming lived in quite another country, a very long way off.  it was a great calamity, no doubt, but nothing could be done, for the fairies had no more gifts left; so they returned very sadly to fairyland, and hoped that the wymps would not find it out.  of course, the wymps did find it out, for they had arranged the whole thing from the very beginning.  still, the wymps are not nearly so bad as they pretend to be; and when they had finished laughing over their joke they did their best to make things right again by going in large numbers to prince charming's christening.  they behaved very noisily when they got there; and they ate every bit of the christening cake and ended in giving the baby prince the only nice gift the wymps have the power to give; and that is the nicest gift in the world, for it is called laughter.  o be sure, there had never been such a topsy-turvey christening party before; but all the guests enjoyed it thoroughly, and that cannot be said of all the parties to which the fairies are invited.  the fairy queen could not help smiling when she heard what happened";
        segmentstrings[8] = "untry, a very long way off.  it was a great calamity, no doubt, but nothing could be done, for the fairies had no more gifts left; so they returned very sadly to fairyland, and hoped that the wymps would not find it out.  of course, the wymps did find it out, for they had arranged the whole thing from the very beginning.  still, the wymps are not nearly so bad as they pretend to be; and when they had finished laughing over their joke they did their best to make things right again by going in large numbers to prince charming's christening.  they behaved very noisily when they got there; and they ate every bit of the christening cake and ended in giving the baby prince the only nice gift the wymps have the power to give; and that is the nicest gift in the world, for it is called laughter.  to be sure, there had never been such a topsy-turvey christening party before; but all the guests enjoyed it thoroughly, and that cannot be said of all the parties to which the fairies are invited.  te fairy queen could not help smiling when she heard what happened.  \"never mind!\" she said.  \"some day, prince charming shall have all the gifts of fairyland, too.  meanwhile, he has something far better than we should have given him.\"  ";
        segmentstrings[9] = "uld not find it out.  of course, the wymps did find it out, for they had arranged the whole thing from the very beginning.  still, the wymps are not nearly so bad as they pretend to be; and when they had finished laughing over their joke they did their best to make things right again by going in large numbers to prince charming's christening.  they behaved very noisily when they got there; and they ate every bit of the christening cake and ended in giving the baby prince the only nice gift the wymps have the power to give; and that is the nicest gift in the world, for it is called laughter.  to be sure, there had never been such a topsy-turvey christening party before; but all the guests enjoyed it thoroughly, and that cannot be said of all the parties to which the fairies are invited.  the fairy queen could not help smiling when she heard what happened.  \"never mind!\" she said.  \"some day, prince charming shall have all the gifts of fairyland, too.  meanwhile, he has something far beter than we should have given him.\"  ";
        
        for(int i = 0; i < 10; i++){
            System.out.println("Segment number "+i+"- length : "+segmentstrings[i].length()+" alphabetic char count : "+countAphabeticChars(segmentstrings[i]));
            if(i > 0){
                System.out.println("Step from segment number "+i+" against segment number "+(i-1)+" : "+segmentstrings[i-1].indexOf(segmentstrings[i].substring(0, 50)));
            }
        }
    }
}
